Skip to content

fix: outline keeps titles; full MD parse stays on Angstrom - #149

Merged
cursor[bot] merged 8 commits into
masterfrom
logseq/fix-outline-plain-and-pos-862d
Aug 31, 2026
Merged

fix: outline keeps titles; full MD parse stays on Angstrom#149
cursor[bot] merged 8 commits into
masterfrom
logseq/fix-outline-plain-and-pos-862d

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Restore Logseq graph-parser compatibility for full markdown parse.

The line scanner remains the outline path (parse_outline_only). Full parse (parseJson, which graph-parser uses) goes back to Angstrom so mixed constructs match published mldoc:

  • definition lists (term / : definition)
  • indented fenced Src (including leading newline / pos_meta)
  • :LOGBOOK: drawers
  • #+BEGIN_QUOTE / #+BEGIN_QUERY (and other org blocks)

Also:

  • try_fast_md_inline treats two trailing spaces before a newline as Hard_Break_Line (CommonMark).
  • # is a hashtag only at start, after whitespace, or after trailing punctuation ('#bar'). URL fragments like http://example.com/a#type are not tags, so :url inference still works.
  • Bare autolinks are still not extracted as property refs.

Tests

  • dune runtest (markdown, outline, org, zip, export-md, export-opml)
  • Logseq deps/graph-parser pnpm test against this JS build
Open in Web Open in Cursor 

#145's outline path dropped heading/paragraph Plain inlines (only
refs/tags survived) and stamped every block with dummy pos_meta
{0,0}. Logseq then showed empty titles, extracted nested headings as
["" "" "a\n- b\n- c"], and failed exporter TODO/SCHEDULED/quote-email
plus generated graph import.

Keep Plain in outline inline, emit real start/end offsets from the
line scanner, and still collect same-line quotes in outline mode.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cursoragent and others added 2 commits August 31, 2026 06:47
ocaml/setup-ocaml@v3 warns that dune-cache will be removed in v4.
Opam switch caching remains enabled via the default cache: true input.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Outline still returns heading titles (Plain + [[page]] / ((block)) / #tag)
along with status, priority, properties, SCHEDULED/DEADLINE, and YAML
front matter on the first block only. Mixed markdown (emphasis, code,
autolinks) stays on the full rendering path.

Property values extract page/tag/block refs with the outline scanner
instead of full Inline.parse, which is the general hot path for
property-heavy Markdown graphs.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@tiensonqin
tiensonqin marked this pull request as ready for review August 31, 2026 09:52
Copilot AI lite review requested due to automatic review settings August 31, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The line scanner is outline-only. Full parse needs drawers, org blocks,
definition lists, and fenced src positions so Logseq graph-parser matches
published mldoc. Property values with macros skip the outline fast scan.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@cursor cursor Bot changed the title fix: keep outline Plain text and record block byte positions fix: outline keeps titles; full MD parse stays on Angstrom Aug 31, 2026
cursoragent and others added 4 commits August 31, 2026 10:21
try_fast_md_inline treated "  \\n" as Plain spaces plus Break_Line, so
org quote blank lines imported as "it's a\\n  \\norg blockquote". Match
Angstrom: two trailing spaces are Hard_Break_Line.

Do not Inline.parse property values just because they contain "{".
{{docs-base-url url}} must stay a plain string so Logseq can expand the
macro and infer :url.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
The outline/inline fast scanners treated any '#' as a tag, so
http://example.com/a#type became Tag "type". That made Logseq infer
:user.property/url as :default instead of :url. Require a whitespace
(or start-of-string) boundary before '#'.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
'#' after a letter is still not a tag (URL fragments). '#' after
whitespace or trailing punctuation is a tag, matching Angstrom and
graph-parser's parse-property tests.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Normal tags at start of text or after a heading marker are unchanged.
Only '#' after a word character (URL fragments) is not a tag.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@cursor
cursor Bot merged commit af453f4 into master Aug 31, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants